#include <iostream>

int main() {
    for (int i = 100; i <= 999; ++i) {
        int sum = 0;
        int temp = i;
        while (temp) {
            int digit = temp % 10;
            sum += digit * digit * digit;
            temp /= 10;
        }
        if (sum == i) {
            std::cout << i << std::endl;
        }
    }
    return 0;
}